Optimal. Leaf size=252 \[ \frac {\left (-3 a^2 B+15 a A b+16 b^2 B\right ) \tan (c+d x) (a+b \sec (c+d x))^2}{60 b d}+\frac {\left (4 a^3 B+12 a^2 A b+9 a b^2 B+3 A b^3\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {\left (-6 a^3 B+30 a^2 A b+71 a b^2 B+45 A b^3\right ) \tan (c+d x) \sec (c+d x)}{120 d}+\frac {\left (-3 a^4 B+15 a^3 A b+52 a^2 b^2 B+60 a A b^3+16 b^4 B\right ) \tan (c+d x)}{30 b d}+\frac {(5 A b-a B) \tan (c+d x) (a+b \sec (c+d x))^3}{20 b d}+\frac {B \tan (c+d x) (a+b \sec (c+d x))^4}{5 b d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.48, antiderivative size = 252, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.226, Rules used = {4010, 4002, 3997, 3787, 3770, 3767, 8} \[ \frac {\left (15 a^3 A b+52 a^2 b^2 B-3 a^4 B+60 a A b^3+16 b^4 B\right ) \tan (c+d x)}{30 b d}+\frac {\left (12 a^2 A b+4 a^3 B+9 a b^2 B+3 A b^3\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {\left (-3 a^2 B+15 a A b+16 b^2 B\right ) \tan (c+d x) (a+b \sec (c+d x))^2}{60 b d}+\frac {\left (30 a^2 A b-6 a^3 B+71 a b^2 B+45 A b^3\right ) \tan (c+d x) \sec (c+d x)}{120 d}+\frac {(5 A b-a B) \tan (c+d x) (a+b \sec (c+d x))^3}{20 b d}+\frac {B \tan (c+d x) (a+b \sec (c+d x))^4}{5 b d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3767
Rule 3770
Rule 3787
Rule 3997
Rule 4002
Rule 4010
Rubi steps
\begin {align*} \int \sec ^2(c+d x) (a+b \sec (c+d x))^3 (A+B \sec (c+d x)) \, dx &=\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 b d}+\frac {\int \sec (c+d x) (a+b \sec (c+d x))^3 (4 b B+(5 A b-a B) \sec (c+d x)) \, dx}{5 b}\\ &=\frac {(5 A b-a B) (a+b \sec (c+d x))^3 \tan (c+d x)}{20 b d}+\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 b d}+\frac {\int \sec (c+d x) (a+b \sec (c+d x))^2 \left (b (15 A b+13 a B)+\left (15 a A b-3 a^2 B+16 b^2 B\right ) \sec (c+d x)\right ) \, dx}{20 b}\\ &=\frac {\left (15 a A b-3 a^2 B+16 b^2 B\right ) (a+b \sec (c+d x))^2 \tan (c+d x)}{60 b d}+\frac {(5 A b-a B) (a+b \sec (c+d x))^3 \tan (c+d x)}{20 b d}+\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 b d}+\frac {\int \sec (c+d x) (a+b \sec (c+d x)) \left (b \left (75 a A b+33 a^2 B+32 b^2 B\right )+\left (30 a^2 A b+45 A b^3-6 a^3 B+71 a b^2 B\right ) \sec (c+d x)\right ) \, dx}{60 b}\\ &=\frac {\left (30 a^2 A b+45 A b^3-6 a^3 B+71 a b^2 B\right ) \sec (c+d x) \tan (c+d x)}{120 d}+\frac {\left (15 a A b-3 a^2 B+16 b^2 B\right ) (a+b \sec (c+d x))^2 \tan (c+d x)}{60 b d}+\frac {(5 A b-a B) (a+b \sec (c+d x))^3 \tan (c+d x)}{20 b d}+\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 b d}+\frac {\int \sec (c+d x) \left (15 b \left (12 a^2 A b+3 A b^3+4 a^3 B+9 a b^2 B\right )+4 \left (15 a^3 A b+60 a A b^3-3 a^4 B+52 a^2 b^2 B+16 b^4 B\right ) \sec (c+d x)\right ) \, dx}{120 b}\\ &=\frac {\left (30 a^2 A b+45 A b^3-6 a^3 B+71 a b^2 B\right ) \sec (c+d x) \tan (c+d x)}{120 d}+\frac {\left (15 a A b-3 a^2 B+16 b^2 B\right ) (a+b \sec (c+d x))^2 \tan (c+d x)}{60 b d}+\frac {(5 A b-a B) (a+b \sec (c+d x))^3 \tan (c+d x)}{20 b d}+\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 b d}+\frac {1}{8} \left (12 a^2 A b+3 A b^3+4 a^3 B+9 a b^2 B\right ) \int \sec (c+d x) \, dx+\frac {\left (15 a^3 A b+60 a A b^3-3 a^4 B+52 a^2 b^2 B+16 b^4 B\right ) \int \sec ^2(c+d x) \, dx}{30 b}\\ &=\frac {\left (12 a^2 A b+3 A b^3+4 a^3 B+9 a b^2 B\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {\left (30 a^2 A b+45 A b^3-6 a^3 B+71 a b^2 B\right ) \sec (c+d x) \tan (c+d x)}{120 d}+\frac {\left (15 a A b-3 a^2 B+16 b^2 B\right ) (a+b \sec (c+d x))^2 \tan (c+d x)}{60 b d}+\frac {(5 A b-a B) (a+b \sec (c+d x))^3 \tan (c+d x)}{20 b d}+\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 b d}-\frac {\left (15 a^3 A b+60 a A b^3-3 a^4 B+52 a^2 b^2 B+16 b^4 B\right ) \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{30 b d}\\ &=\frac {\left (12 a^2 A b+3 A b^3+4 a^3 B+9 a b^2 B\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {\left (15 a^3 A b+60 a A b^3-3 a^4 B+52 a^2 b^2 B+16 b^4 B\right ) \tan (c+d x)}{30 b d}+\frac {\left (30 a^2 A b+45 A b^3-6 a^3 B+71 a b^2 B\right ) \sec (c+d x) \tan (c+d x)}{120 d}+\frac {\left (15 a A b-3 a^2 B+16 b^2 B\right ) (a+b \sec (c+d x))^2 \tan (c+d x)}{60 b d}+\frac {(5 A b-a B) (a+b \sec (c+d x))^3 \tan (c+d x)}{20 b d}+\frac {B (a+b \sec (c+d x))^4 \tan (c+d x)}{5 b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 3.50, size = 181, normalized size = 0.72 \[ \frac {15 \left (4 a^3 B+12 a^2 A b+9 a b^2 B+3 A b^3\right ) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (8 \left (5 b \left (3 a^2 B+3 a A b+2 b^2 B\right ) \tan ^2(c+d x)+15 \left (a^3 A+3 a^2 b B+3 a A b^2+b^3 B\right )+3 b^3 B \tan ^4(c+d x)\right )+15 \left (4 a^3 B+12 a^2 A b+9 a b^2 B+3 A b^3\right ) \sec (c+d x)+30 b^2 (3 a B+A b) \sec ^3(c+d x)\right )}{120 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.54, size = 249, normalized size = 0.99 \[ \frac {15 \, {\left (4 \, B a^{3} + 12 \, A a^{2} b + 9 \, B a b^{2} + 3 \, A b^{3}\right )} \cos \left (d x + c\right )^{5} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left (4 \, B a^{3} + 12 \, A a^{2} b + 9 \, B a b^{2} + 3 \, A b^{3}\right )} \cos \left (d x + c\right )^{5} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (8 \, {\left (15 \, A a^{3} + 30 \, B a^{2} b + 30 \, A a b^{2} + 8 \, B b^{3}\right )} \cos \left (d x + c\right )^{4} + 24 \, B b^{3} + 15 \, {\left (4 \, B a^{3} + 12 \, A a^{2} b + 9 \, B a b^{2} + 3 \, A b^{3}\right )} \cos \left (d x + c\right )^{3} + 8 \, {\left (15 \, B a^{2} b + 15 \, A a b^{2} + 4 \, B b^{3}\right )} \cos \left (d x + c\right )^{2} + 30 \, {\left (3 \, B a b^{2} + A b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{240 \, d \cos \left (d x + c\right )^{5}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.82, size = 722, normalized size = 2.87 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.71, size = 382, normalized size = 1.52 \[ \frac {A \,a^{3} \tan \left (d x +c \right )}{d}+\frac {a^{3} B \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {a^{3} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {3 A \,a^{2} b \sec \left (d x +c \right ) \tan \left (d x +c \right )}{2 d}+\frac {3 A \,a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {2 a^{2} b B \tan \left (d x +c \right )}{d}+\frac {a^{2} b B \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{d}+\frac {2 A a \,b^{2} \tan \left (d x +c \right )}{d}+\frac {A a \,b^{2} \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{d}+\frac {3 B a \,b^{2} \tan \left (d x +c \right ) \left (\sec ^{3}\left (d x +c \right )\right )}{4 d}+\frac {9 B a \,b^{2} \sec \left (d x +c \right ) \tan \left (d x +c \right )}{8 d}+\frac {9 B a \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8 d}+\frac {A \,b^{3} \tan \left (d x +c \right ) \left (\sec ^{3}\left (d x +c \right )\right )}{4 d}+\frac {3 A \,b^{3} \sec \left (d x +c \right ) \tan \left (d x +c \right )}{8 d}+\frac {3 A \,b^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8 d}+\frac {8 b^{3} B \tan \left (d x +c \right )}{15 d}+\frac {b^{3} B \tan \left (d x +c \right ) \left (\sec ^{4}\left (d x +c \right )\right )}{5 d}+\frac {4 b^{3} B \tan \left (d x +c \right ) \left (\sec ^{2}\left (d x +c \right )\right )}{15 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.83, size = 341, normalized size = 1.35 \[ \frac {240 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{2} b + 240 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} A a b^{2} + 16 \, {\left (3 \, \tan \left (d x + c\right )^{5} + 10 \, \tan \left (d x + c\right )^{3} + 15 \, \tan \left (d x + c\right )\right )} B b^{3} - 45 \, B a b^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 15 \, A b^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 60 \, B a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 180 \, A a^{2} b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 240 \, A a^{3} \tan \left (d x + c\right )}{240 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.79, size = 470, normalized size = 1.87 \[ \frac {\mathrm {atanh}\left (\frac {4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {B\,a^3}{2}+\frac {3\,A\,a^2\,b}{2}+\frac {9\,B\,a\,b^2}{8}+\frac {3\,A\,b^3}{8}\right )}{2\,B\,a^3+6\,A\,a^2\,b+\frac {9\,B\,a\,b^2}{2}+\frac {3\,A\,b^3}{2}}\right )\,\left (B\,a^3+3\,A\,a^2\,b+\frac {9\,B\,a\,b^2}{4}+\frac {3\,A\,b^3}{4}\right )}{d}-\frac {\left (2\,A\,a^3-\frac {5\,A\,b^3}{4}-B\,a^3+2\,B\,b^3+6\,A\,a\,b^2-3\,A\,a^2\,b-\frac {15\,B\,a\,b^2}{4}+6\,B\,a^2\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (\frac {A\,b^3}{2}-8\,A\,a^3+2\,B\,a^3-\frac {8\,B\,b^3}{3}-16\,A\,a\,b^2+6\,A\,a^2\,b+\frac {3\,B\,a\,b^2}{2}-16\,B\,a^2\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (12\,A\,a^3+20\,B\,a^2\,b+20\,A\,a\,b^2+\frac {116\,B\,b^3}{15}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-8\,A\,a^3-\frac {A\,b^3}{2}-2\,B\,a^3-\frac {8\,B\,b^3}{3}-16\,A\,a\,b^2-6\,A\,a^2\,b-\frac {3\,B\,a\,b^2}{2}-16\,B\,a^2\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,A\,a^3+\frac {5\,A\,b^3}{4}+B\,a^3+2\,B\,b^3+6\,A\,a\,b^2+3\,A\,a^2\,b+\frac {15\,B\,a\,b^2}{4}+6\,B\,a^2\,b\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{3} \sec ^{2}{\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________